//
//  AdressTableViewCell.m
//  KuWoCan
//
//  Created by 周小宏 on 2017/5/11.
//  Copyright © 2017年 hwd. All rights reserved.
//

#import "AdressTableViewCell.h"

@interface AdressTableViewCell ()

@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *descriptionLabel;
@end

@implementation AdressTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = [UIColor whiteColor];

        self.titleLabel = [UILabel new];
        self.titleLabel.font = KwFont(14);
        self.titleLabel.textColor = [UIColor grayColor];
//        self.titleLabel.text = self.titleArr[indexPath.row];
        [self.contentView addSubview:self.titleLabel];
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(@20);
            make.centerY.equalTo(self.contentView);
        }];

        self.descriptionLabel = [UILabel new];
        self.descriptionLabel.font = KwFont(14);
        self.descriptionLabel.textColor = [UIColor grayColor];
        [self.contentView addSubview:self.descriptionLabel];
        [self.descriptionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.contentView);
            make.right.equalTo(self.contentView).offset(-20 * screenW_6);
            make.left.greaterThanOrEqualTo(self.titleLabel.mas_right);
        }];

        UIView *lineView = [UIView new];
        lineView.backgroundColor = KwGaryColor;
        [self.contentView addSubview:lineView];
        [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.height.equalTo(@1.5);
            make.left.equalTo(@15);
            make.right.equalTo(@-20);
            make.bottom.equalTo(@-5);
        }];
    }
    return self;
}

- (void)configCellTitle:(NSString *)title Description:(NSString *)description {
    self.titleLabel.text = title;
    self.descriptionLabel.text = description;
}

@end
